/*
*
 * Author: J Conrad Stack
 * 
 * Program 4: 
 * a collection of methods which perform various mathmatical procedures
 */ 


#ifndef USERMATH_H
#define USERMATH_H
 
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>


/*
*
 * purpose: to calculate the sum of numbers n to m
 * parameters: n and m should be valid integers
 * returns: the sum of all integers from n to m
 * side-effects: none
 * sample-call: findSum(4,5) should return 9
 */ 
int findSum(int n, int m);

/*
*
 * purpose: to calculate the product of numbers n to m
 * parameters: n and m should be integers
 * returns: the product of all integers from n to m
 * side-effects: none
 * sample-call: findProduct(4,5) should return 20
 */ 
unsigned long findProduct(int n, int m);

/*
*
 * purpose: to check whether given numbers are inorder from smallest to greatest
 * parameters: n number of variables-1, ... the list of variables to check
 * returns: 1 if the list is in order, 0 if not in order
 * side-effects: none
 * sample-call: inOrder(2,3,4) returns 1, since 3 and 4 are in order
 */ 
int inOrder(int n,...);


/*
*
 * purpose: to check whether the list of numbers are all primes and greater than 1
 * parameters: n number of variables, ... list of numbers to check for prime
 * returns: 1 if all numbers in list are prime and greater than 1 , 0 if not
 * side-effects: none
 * sample-call: arePrime(2,5,17) should return 1 since both 5 and 17 are prime and > 1
 */ 
int arePrime(int n,...);


#endif

